<!DOCTYPE HTML>
<!--
	Eventually by HTML5 UP
	html5up.net | @ajlkn
	Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
	<head>
		<title><%= title %></title>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
		<!--[if lte IE 8]><script src="/js/ie/html5shiv.js"></script><![endif]-->
		<link rel="stylesheet" href="/css/main.css" />
		<!--[if lte IE 8]><link rel="stylesheet" href="/css/ie8.css" /><![endif]-->
		<!--[if lte IE 9]><link rel="stylesheet" href="/css/ie9.css" /><![endif]-->
	</head>
	<body style="font-family:微软雅黑;background: #ccc url(/images/bg01.jpg) no-repeat;-moz-background-size:cover;-ms-background-size:cover;-webkit-background-size:cover;background-size:cover;">

		<!-- Header -->
			<header id="header">
				<a href="/"><p><%= companyName %></p></a>
				<h1>运营管理后台 <span style="font-size:0.6em;color:rgba(255, 255, 255, 0.5);">V1.0</span></h1>
			</header>

		<!-- Signup Form -->
			<div id="signup-form">
				<input type="text" name="user_email" id="email" placeholder="Username" />
				<input type="password" name="user_pwd" id="password" placeholder="Password" />
				<input type="submit" value="登录" onclick="submits()" id="subBtn"/>
			</div>

		<!-- Footer -->
			<footer id="footer">
				<ul class="icons">
					<!-- <li><a href="#" class="icon fa-weibo"><span class="label">微博</span></a></li> -->
					<li><a href="#" class="icon fa-weixin"><span class="label">微信公众号</span></a></li>
					<li><a href="tel:15807088855" class="icon fa-phone"><span class="label">服务热线</span></a></li>
					<li><a href="email:by371@163.com" class="icon fa-envelope-o"><span class="label">Email</span></a></li>
				</ul>
				<ul class="copyright">
					<li>&copy;<%= companyName %>.</li><li><a href="http://www.miitbeian.gov.cn/state/outPortal/loginPortal.action# " style="text-decoration:none;color:#c8c8c8">豫ICP备16034054号-1</a></li>
				</ul>
			</footer>

		<!-- Scripts -->
			<!--[if lte IE 8]><script src="/js/ie/respond.min.js"></script><![endif]-->
			<!-- <script src="/js/main.js"></script> -->

	</body>
	<script type="text/javascript" src="/js/jquery.min.js"></script>
	<script type="text/javascript">
	    function tab() {
	        if (event.keyCode == 13) {
	            submits();
	        }
	    }

	    function submits() {
	        $('#subBtn').attr('disabled', 'true');
	        var user_email = $('input[name=user_email]').val();
	        var user_pwd = $('input[name=user_pwd]').val();
	        if (!user_email || !user_pwd) {
	            $('#subBtn').removeAttr('disabled');
	            return alert('请输入您的密码或EMAIL')
	        }
	        var obj = {
	            "user_email": user_email,
	            "user_pwd": user_pwd
	        };
	        $.ajax({
	            type: "post",
	            url: "/AM_login",
	            data: obj,
	            dataType: "json",
	            success: function(data) {
	                $('#subBtn').removeAttr('disabled');
	                if(data.status==true){
	                    window.location = '/admin/index';
	                }else{
	                    alert(data.message);
	                }
	            },
	            error: function(data) {
	                $('#subBtn').removeAttr('disabled');
	                alert(data.responseText);
	            }
	        });

	    }
	</script>
</html>